package cn.findviewbydream.evil.main.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/********************************************
 * 工程名：MealOrder
 * 包名：cn.findviewbydream.evil.main.controller
 * 时间：16-12-21
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：登录页面
 ********************************************/
@Controller
public class LoginController
{
    /**
     * web端登录入口
     */
    @RequestMapping(value = "/web/login", method = RequestMethod.POST)
    @ResponseBody
    public boolean webLogin(HttpSession session)
    {
        if (session.getAttribute("WEBSOCKET_USERID") == null)
        {
            session.setAttribute("WEBSOCKET_USERID", "WEB_HANDLER");
            return true;
        }
        return false;
    }
}
